#ifndef MONITORINGDEVICEDELETE_H
#define MONITORINGDEVICEDELETE_H

#include <QWidget>
#include <QJsonObject>
#include "SnaillTcpClient.h"
#include "userModel.h"
#include "deviceModel.h"
#include "DeviceDeleteBtnDelegate.h"
#include "MonitoringDeviceTableModel.h"
#include <QList>
#include <QJsonArray>
#include "MonitoringMainData.h"
namespace Ui {
class MonitoringDeviceDelete;
}

class MonitoringDeviceDelete : public QWidget
{
    Q_OBJECT

public:
    explicit MonitoringDeviceDelete(QWidget *parent = nullptr,userModel*model=nullptr);
    ~MonitoringDeviceDelete();

public slots:
    void handleDataReceived(const QByteArray &);
    QList<deviceModel> getDeviceList(const QString &jsonString);
    void onDeviceDeleted(const deviceModel& device);
    void onEditButtonClicked(int row);
    void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>());
    void checkDevice(int row);
protected:
    void showEvent(QShowEvent *event) override;

private:
    Ui::MonitoringDeviceDelete *ui;
    userModel*umodel;
    MonitoringDeviceTableModel devmodel;
    DeviceDeleteBtnDelegate delegate;
    QList<deviceModel> deviceList;
    MonitoringMainData*p_mainData;
};

#endif // MONITORINGDEVICEDELETE_H
